package org.droid.campusorder.common;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * @author Jerry
 * 内置数据库 ，单例
 * 
 * */
public class Pre {

	private Context context;
	SharedPreferences settings;
	SharedPreferences.Editor editor;
	private static Pre p;
	private String NAME = "CampusOrder";
	
	public static  Pre getInstance(Context context){
		if(p==null){
			p = new Pre(context);
		}
		return p;
	}
	
	private Pre(Context context){
		this.context = context;
		settings = this.context.getSharedPreferences(NAME, 0);
		editor = settings.edit();
	}
	
	public void setServer(String server){
		editor.putString("server", server);
		editor.commit();
	}
	public String getServer(){
		return settings.getString("server", "");
	}
}
